package com.tsc.design.responsibilityMode.example1;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: chentl
 * @Date: 2025/09/17/18:50
 * @Description:
 */
public class GeneralManager extends LeaveHandler{

    @Override
    public String handleRequest(LeaveRequest request ) {
        if (request.getLeaveDays() > 7 && request.getLeaveDays() <= 15) {
            return String.format("总经理批准了%s的%d天请假申请，理由：%s",
                    request.getEmployeeName(),
                    request.getLeaveDays(),
                    request.getReason());
        } else if (request.getLeaveDays() > 15) {
            return String.format("总经理拒绝了%s的%d天请假申请，理由：假期过长",
                    request.getEmployeeName(),
                    request.getLeaveDays());
        } else {
            return "请假申请不符合规范";
        }
    }
}
